﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiscoveryLogic.Workflows.Components.Markov.MaxEnt
{
    /// <summary>
    /// The context of a decision point during training.  This includes
    /// contextual predicates and an outcome.
    /// </summary>
    public class TrainingEvent
    {
        private string mOutcome;
        private string[] mContext;

        /// <summary>
        /// The outcome label for this training event.
        /// </summary>
        virtual public string Outcome
        {
            get
            {
                return mOutcome;
            }
        }

        /// <summary>
        /// Gets the context for this training event.
        /// </summary>
        /// <returns>
        /// A string array of context values for this training event.
        /// </returns>
        virtual public string[] GetContext()
        {
            return mContext;
        }

        /// <summary>
        /// Constructor for a training event.
        /// </summary>
        /// <param name="outcome">
        /// the outcome label
        /// </param>
        /// <param name="context">
        /// array containing context values
        /// </param>
        public TrainingEvent(string outcome, string[] context)
        {
            mOutcome = outcome;
            mContext = context;
        }

        /// <summary>
        /// Override providing text summary of the training event.
        /// </summary>
        /// <returns>
        /// Summary of the training event.
        /// </returns>
        public override string ToString()
        {
            return mOutcome + " " + string.Join(", ", mContext);
        }
    }
}
